<?php
function login($currentPage) {
	include 'options_meta.php';
	if ( ($_COOKIE["User"]!=$user) || ($_COOKIE["Password"]!=$password)  ){
		if (isset($_GET["user"])&&isset($_GET["password"])) {
			setcookie  ( "Password" , $_GET["password"] );
			setcookie  ( "User" , $_GET["user"] );
			if (($_GET["user"]==$user)&&($_GET["password"]==$password)){
				header ("Location: ?reload=true");
				exit();
			} else {
			echo "Incorrect password";
			}
		}?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php echo $backend_name;?> Configuration</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="backdrop">
<div id="admin_main">
<div id="header">
	<h3 class="page_title"><?php echo $backend_name;?></h3>
</div>
<div id="content">
	<form name="input" action="<?php echo $currentPage ?>" method="get">
				Username: <input type="text" name="user" /> <br />
				Password: <input type="password" name="password" /> <br />
				<input type="submit" value="Submit" />
	</form> 
	</div>
</div>
</div>
</body>
</html>

<?php 
		exit();
		}
	}
?>